package com.bocloud.cmp.service.utils;

/**
 * 
 * @author oywl
 *
 */
public class PercentUtil {
    /**
     * 计算百分比
     * @param num
     * @param total
     * @return
     */
    public static Float getPercent(Integer num, Integer total) {
        Float percent = (float) 0.00;
        if (0 == total) {
            percent = (float) 0.00;
        } else {
            percent = (float) Math.round((num * 1.0 / total)*10000)/10000;
        }
        return percent*100;
    }
}
